const mongoose = require('mongoose')

const Schema = mongoose.Schema

mongoose.connect('mongodb://localhost/vue-blog')

const tagSchema = new Schema({ 
  tags: {
    type: [
      {
        "tag_name": String,
        "tag_number":String
      }
    ]
  }
})

// const Tag = mongoose.model('Tag',tagSchema)

// Tag.create({
//   tag: ['前端','后端','数据库','技术']
// }).then((res) => {
//   console.log('标签创建成功');
// }).catch((err) => {
//   console.log('标签创建失败');
// });

module.exports = mongoose.model('Tag', tagSchema)